package com.example.project.quartz.task;

import com.example.project.service.InputExtBusinessService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * Created by dell on 2017/5/29.
 */
@Service
public class MyTask3 extends BaseTask{

    @Autowired
    InputExtBusinessService inputExtBusinessService;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException{
        System.out.println("MyTask3.execute() "+new Date());
        inputExtBusinessService.quartzBonusNum();
    }


    @Override
    public String getCronExpression() {
        //凌晨2点触发
        return "0 0 2 * * ?";
    }

}
